package com.zr.mapper;

import com.zr.entity.Role;
import com.zr.entity.User;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Set;

/**
 * @author: peterChen
 * @date: 2019/11/8 17:07
 * @description: com.zr.mapper
 * @version: 1.0
 */
public interface AuthMapper extends Mapper<User> {
    /**
     * 根据用户请求的uri获取所需要的权限
     * @param uri
     * @return
     */
    List<Role> selectRolesByURI(@Param("uri") String uri);

    /**
     * 根据用户id查询角色信息
     * @param id
     * @return
     */
    Set<Role> selectRolesByUserId(@Param("id") Long id);

    User selectUserByUsername(@Param("username") String username);

}
